package com.yowasa.xiuxian.engine.battle.enemy.strategy;

import com.google.common.collect.Lists;
import com.yowasa.xiuxian.annoations.BS;
import com.yowasa.xiuxian.engine.battle.strategy.BaseSpellStrategy;
import com.yowasa.xiuxian.entity.bo.battle.BattleContent;
import com.yowasa.xiuxian.entity.bo.battle.UserBattleContent;
import com.yowasa.xiuxian.entity.bo.user.UserBO;
import com.yowasa.xiuxian.entity.enums.ElementEnum;
import com.yowasa.xiuxian.exception.HandlerException;
import com.yowasa.xiuxian.service.helper.BattleHelper;
import com.yowasa.xiuxian.util.RandomUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@BS(name = "至圣的恩典")
@Order(200)
@Component
public class ShengJuanEnDian extends BaseSpellStrategy {
    @Autowired
    private BattleHelper battleHelper;

    @Override
    public ElementEnum getElement() {
        return null;
    }

    @Override
    public void action(UserBattleContent first, UserBattleContent second, BattleContent content) {
        int orgAtk = first.getBattleInfo().getAtk();

        int def = Math.min(second.getBattleInfo().getDef(), second.getBattleInfo().getRes());
        int atk = (int) (orgAtk * 1.5);
        int dmg = battleHelper.calAtk(atk, def);

        battleHelper.autoAction(this, first, second, content, dmg, RandomUtil.choice(Lists.newArrayList("至圣的恩典","博爱的圣眷","至伟的真理")));
    }

    @Override
    public void limit(UserBO user) {}

    @Override
    public String limitDesc() {
        return "无";
    }

    @Override
    public String desc() {
        return "⚡~伟大的圣谕~⚡~高贵的升华~⚡~至圣的恩典~⚡~博爱的圣眷~⚡~至伟的真理~⚡~谕降众生~⚡\n来自深渊的普通攻击形式，会自适应你的物抗和法抗造成1.5倍的伤害";
    }


}
